module testbench; 
mailbox #(int) mbox=new(2); 

task send();
for (int i =0; i<4 ;i++ ) begin
    mbox.put(i);
    $display("send:%0d",i);
    // #1;
end
endtask

task recv();
int a;
for (int i =0; i<4 ;i++ ) begin
    mbox.get(a);
    $display("\t\tget-1 cnt=%0d val=%0d",i,a);
    #2;
end
endtask

task recv2();
int a;
for (int i =0; i<4 ;i++ ) begin
    mbox.get(a);
    $display("\t\tget-2 cnt=%0d val=%0d",i,a);
    #3;
end
endtask

initial begin
    $display("\033[32m\t\t!!\tcode begin\t!!");  

    fork  
        send();
        recv();
        recv2(); 
    join
 
    $display("\t\t!!\tcode end\t!!\033[0m");
    $finish; 
end 
endmodule 